/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.gastronomico.demo.web;

import com.gastronomico.demo.domain.TipoComida;
import com.gastronomico.demo.service.TipoComidaService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

/**
 *
 * @author MIGUELANGEL
 */
@Controller
public class TipoComidaListaController {

    @Autowired
    TipoComidaService service;

    @RequestMapping(value = "/tipoComidaLista.htm", method = RequestMethod.GET)
    public ModelAndView tipoComida(){
        ModelAndView mav = new ModelAndView("tipoComidaLista");
        List<TipoComida> tipoComidaLista = service.obtenerTipoComidas();
        System.out.println("TIPOS DE COMIDA:" + tipoComidaLista.size());
        mav.addObject("tipoComidaLista", tipoComidaLista);
        return mav;
    }

}
